/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bs.facturacion.dao;

import bs.facturacion.modelo.ComprobanteFacturacion;
import bs.global.dao.BaseDAO;
import bs.global.modelo.ComprobantePK;
import java.util.List;
import java.util.Map;
import javax.ejb.Stateless;

/**
 *
 * @author Claudio
 */
@Stateless
public class ComprobanteFacturacionDAO extends BaseDAO {

    public ComprobanteFacturacion getComprobante(ComprobantePK idPK){

        return em.find(ComprobanteFacturacion.class, idPK);
    }

    public void eliminar(ComprobanteFacturacion o) throws Exception{

        super.eliminar(ComprobanteFacturacion.class, o.getCodigo());
    }

    public List<ComprobanteFacturacion> getLista() {
        return getLista(ComprobanteFacturacion.class, true , -1, -1);
    }

    public List<ComprobanteFacturacion> getLista(Map<String, String> filtro) {

        String sQuery = "SELECT i FROM ComprobanteFacturacion i ";
              sQuery += generarStringFiltro(filtro,"i", true);

        return queryList(ComprobanteFacturacion.class, sQuery);
    }



    
    
    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Business Method")
 
}
